#ifndef __AppSettings_h_
#define __AppSettings_h_

#include <OgreRoot.h>
#include "NxOgre.h"
#include <fstream>
#include <iostream> 
#include <string>
#include <sstream>
#include <stdio.h>
#include "tinyxml.h"
#include "logwriter.h"

class AppSettings
{

	class WaterSettings
	{
	public:
		WaterSettings(void);
		~WaterSettings(void);

		void resetToDefault(void);

	public:
			unsigned int mMaxParticles;
			NxOgre::Real mKernelRadiusMultiplier;
			NxOgre::Real mRestParticlesPerMetre;
			unsigned int mPacketSizeMultiplier;
			NxOgre::Real mMotionLimitMultiplier;
			NxOgre::Real mCollisionDistanceMultiplier;
			NxOgre::Real mStiffness;
			NxOgre::Real mViscosity;
			NxOgre::Real mRestDensity;
			NxOgre::Real mStartHeight;
			NxOgre::Real mParticleLifetime;
			NxOgre::Real mRate;
			NxOgre::Real mFluidSpeed;
			NxOgre::Real mReplusionCoefficient;
			NxOgre::Real mDimensionX;
			NxOgre::Real mDimensionY;
			NxOgre::Real mParticleSize;
	};

	//----------------------------------------------------------------------------------

	class ApplicationSettings
	{
	public:
		ApplicationSettings(void);
		~ApplicationSettings(void);

		void resetToDefault(void);

	public:
			bool bAllowDevConsole;
			bool bSandBoxMode;
			bool bUseHardwarePhysX;
			bool bUseShadows;
			bool bLogBenchmark;
			Ogre::String sServerAddress;
			int nPort;
	};

	//----------------------------------------------------------------------------------
	public:

	AppSettings(void);
	~AppSettings(void);

	bool loadSettings(Ogre::String fileName);
	bool loadSettings(void);
	void saveSettings(void);

	WaterSettings waterSettings;
	ApplicationSettings applicationSettings;

	private:
		TiXmlDocument settingsFile;
		TiXmlElement *root;
};

#endif // #ifndef __AppSettings_h_
